package com.example.server.api.service.impl;

import com.example.server.api.dto.ElasticCityDto;
import com.example.server.api.service.ElasticManager;
import com.example.server.service.ECityService;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;
import java.util.List;


@DubboService
public class ElasticManagerImpl implements ElasticManager {

    @Resource
    private ECityService eCityService;

    @Override
    public ElasticCityDto addCity(ElasticCityDto city) {
        return this.eCityService.saveCity(city);
    }

    @Override
    public List<ElasticCityDto> listCity() {
        return eCityService.listCity();
    }

    @Override
    public boolean addCityV2(ElasticCityDto cityDto) {
        return eCityService.addCity(cityDto);
    }

    @Override
    public List<ElasticCityDto> top(Integer num) {
        return eCityService.listTop(num);
    }
}
